<!--
  This template loads for the 'tab.friend-detail' state (app.js)
  'friend' is a $scope variable created in the FriendsCtrl controller (controllers.js)
  The FriendsCtrl pulls data from the Friends service (service.js)
  The Friends service returns an array of friend data
-->
<ion-view view-title="{{chat.name}}">
  <ion-content class="padding" ng-controller="findPageCtrl">
    <div ng-show="show.formShow">
      <button class="button button-block button-royal" ng-click="showQuery()">条件查询</button>
    </div>
    <div class="item" ng-show="show.total">
      <h6>合计：￥{{incomeCount}}</h6>
    </div>
    <div ng-show="show.formHide">
      <label class="item item-input">
        <input id="num" type="text" name="num" placeholder="收据号">
      </label>
      <div class="item item-input item-select">
        <div class="input-label">
          付款类别
        </div>
        <select id="income-action" ng-model="addLessonLesson">
          <option selected id="allAction">全部</option>
          <option ng-repeat="x in action" id="{{x.id}}" >{{x.name}}</option>
        </select>
      </div>
      <label class="item item-input">
        开始日期
        <input type="date" id="startDate" name="startDate" style="text-align: right">
      </label>
      <label class="item item-input">
        结束日期
        <input type="date" id="endDate" name="endDate" style="text-align: right">
      </label>
      <div class="padding">
        <button id="findIncome" class="button button-block button-royal" ng-click="findByQuery()">查 询</button>
      </div>
    </div>
    <div ng-show="show.tableShow">
      <ion-list ng-repeat="i in income">
        <div class="item item-divider">
          {{i.date}}
          <h4>收据号：{{i.num}}</h4>
        </div>
        <div class="item">
          {{i.student}}
          <h6>￥{{i.pay}}</h6>
          <p>{{i.action}}</p>
        </div>
      </ion-list>
    </div>
  </ion-content>
</ion-view>
